import { setToken, getToken } from '@/utils/auth'
export default {
  namespaced: true,
  state: {
    yf_token: getToken() || ''
  },
  mutations: {
    SET_TOKEN(state, token) {
      state.yf_token = token
      // console.log(token)
      setToken(token)
    }
  },
  actions: {
    login(context, token) {
      context.commit('SET_TOKEN', token)
    }
  }
}
